﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _180FrameWork.Common
{
    public class LocationHelper
    {
      public static string GetAppPath()
      {
          string path = "";
          if ((System.Environment.CurrentDirectory + @"\") == AppDomain.CurrentDomain.BaseDirectory)//windows应用程序
          {
              path = AppDomain.CurrentDomain.BaseDirectory;
          }
          else
          {
              path = AppDomain.CurrentDomain.BaseDirectory + @"Bin\";
          }
          return path;
      }

      /// <summary>
      /// 获取64位或者32位的ProgramFiles路径
      /// </summary>
      /// <returns></returns>
      public static string GetProgramFilesPath()
      {
          if (8 == IntPtr.Size || (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"))))
          {
              return Environment.GetEnvironmentVariable("ProgramFiles(x86)");
          }
          return Environment.GetEnvironmentVariable("ProgramFiles");
      }

    }
}
